home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Burning & Media / VLC Media Player 0.9.6 / vlc-0.9.6-win32.exe / lua / http / requests / browse.xml next >
Extensible Markup Language  |  2008-11-13  |  2KB  |  49 lines

  1. <?xml version="1.0" encoding="utf-8" standalone="yes" ?<?vlc print'>'?>
  2. <?vlc --[[
  3. vim:syntax=lua
  4. <!--  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
  5. <  browse.xml: VLC media player web interface
  6. < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
  7. <  Copyright (C) 2005-2006 the VideoLAN team
  8. <  $Id$
  9. <  Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
  10. <  This program is free software; you can redistribute it and/or modify
  11. <  it under the terms of the GNU General Public License as published by
  12. <  the Free Software Foundation; either version 2 of the License, or
  13. <  (at your option) any later version.
  14. <  This program is distributed in the hope that it will be useful,
  15. <  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. <  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. <  GNU General Public License for more details.
  18. <  You should have received a copy of the GNU General Public License
  19. <  along with this program; if not, write to the Free Software
  20. <  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  21. < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  22. ]] ?>
  23.  
  24. <root>
  25. <?vlc
  26. local dir = _GET["dir"]
  27. if dir then
  28.   if dir == "~" then dir = vlc.misc.homedir() end
  29.   dir = common.realpath(dir.."/")
  30.   local d = vlc.net.opendir(dir)
  31.   table.sort(d)
  32.   for _,f in pairs(d) do
  33.     if f == ".." or not string.match(f,"^%.") then
  34.       local df = common.realpath(dir..f)
  35.       local s = vlc.net.stat(df)
  36.       local path, name = vlc.strings.convert_xml_special_chars( df, f )
  37.       print("<element")
  38.       for k,v in pairs(s) do print(" "..k.."='"..v.."'") end
  39.       print(" path='"..path.."' name='"..name.."'/>\n")
  40.     end
  41.   end
  42. end
  43. ?>
  44. </root>
  45.